#!/bin/sh
#
# Testing script
#

echo "Test Results" > testresults.txt
make
for i in "runtime" "indexattr" "fast" "comments" "anonedge" "recursivecrawl" "depthfirsts" "binops" "scope" "blockorder" "arrays" "attributes" "nodetest" "basiccrawl" "contexts" "edgetest" "func" "globals" "ruleaddby" 
do  
echo $i
cat test/$i | ./digr > backend/$i.cpp 
cd backend
g++ $i.cpp digr.cpp -o digrtest
./digrtest > ../test/$i.out 
cd ..
if diff  test/$i.out test/$i.gold > /dev/null ; then
	echo $i is good 
	echo $i is good >> testresults.txt
else
	echo something wrong in $i
	echo something wrong in $i >> testresults.txt
fi
done
